import ElementPlus from "element-plus";
import {language, messages} from "../lang/index.js";
import * as ElementPlusIconsVue from '@element-plus/icons-vue'


function setupElementPlus(app) {
  // 注册Element所有图标
  for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
  }
  // 改成自动按需导入
  // 注册Element组件
  app.use(ElementPlus, {
    locale: messages[language]
  })
}

export {setupElementPlus}


